package com.project.bean;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDate;
import java.util.List;

/**
 * 采购详情实体类
 */
public class BuyBean {
    /**编号*/
    private int id;
    /**所属供应商*/
    private SuppliersBean sup;
    /**采购日期*/
    @JsonFormat( pattern = "yyyy-MM-dd")
    private LocalDate buyDate = LocalDate.now();
    /**采购员姓名*/
    private String userName;
    /**采购物品集合*/
    private List<BuyInfoBean> buyInfoList;

    public BuyBean() {
    }

    public BuyBean(int supId, String userName) {
        this.sup = new SuppliersBean();
        this.sup.setId(supId);
        this.userName = userName;
    }

    public List<BuyInfoBean> getBuyInfoList() {
        return buyInfoList;
    }

    public void setBuyInfoList(List<BuyInfoBean> buyInfoList) {
        this.buyInfoList = buyInfoList;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public SuppliersBean getSup() {
        return sup;
    }

    public void setSup(SuppliersBean sup) {
        this.sup = sup;
    }

    public LocalDate getBuyDate() {
        return buyDate;
    }

    public void setBuyDate(LocalDate buyDate) {
        this.buyDate = buyDate;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Override
    public String toString() {
        return "BuyBean{" +
                "id=" + id +
                ", sup=" + sup +
                ", buyDate=" + buyDate +
                ", userName='" + userName + '\'' +
                ", buyInfoList=" + buyInfoList +
                '}';
    }


}
